home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 November / Chip Kasım 2000.iso / prog / share / 11 / setup.exe / %MAINDIR% / DEMOS / CIMIME / MIME / frmMain.frm (.txt) next >
Encoding:
Visual Basic Form  |  2000-09-07  |  9.4 KB  |  283 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "Crescent Internet ToolPak MIME ActiveX Component"
  4.    ClientHeight    =   2880
  5.    ClientLeft      =   1065
  6.    ClientTop       =   2805
  7.    ClientWidth     =   7065
  8.    Height          =   3285
  9.    Left            =   1005
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2880
  12.    ScaleWidth      =   7065
  13.    Top             =   2460
  14.    Width           =   7185
  15.    Begin VB.CommandButton cmdQuit 
  16.       Caption         =   "Quit"
  17.       Height          =   375
  18.       Left            =   5760
  19.       TabIndex        =   6
  20.       Top             =   600
  21.       Width           =   1095
  22.    End
  23.    Begin VB.Frame fraStatus 
  24.       Height          =   135
  25.       Left            =   240
  26.       TabIndex        =   3
  27.       Top             =   1080
  28.       Width           =   6615
  29.    End
  30.    Begin VB.CommandButton cmdDecode 
  31.       Caption         =   "Decode A File"
  32.       Height          =   375
  33.       Left            =   240
  34.       TabIndex        =   2
  35.       Top             =   600
  36.       Width           =   2295
  37.    End
  38.    Begin VB.CommandButton cmdEncode 
  39.       Caption         =   "Encode A File"
  40.       Height          =   375
  41.       Left            =   240
  42.       TabIndex        =   1
  43.       Top             =   120
  44.       Width           =   2295
  45.    End
  46.    Begin CIMIMELib.CIMIME CIMIME1 
  47.       Height          =   450
  48.       Left            =   6240
  49.       Top             =   2040
  50.       Width           =   480
  51.       _Version        =   65537
  52.       _ExtentX        =   847
  53.       _ExtentY        =   794
  54.       _StockProps     =   0
  55.       SourceFilename  =   ""
  56.       DestinationFilename=   ""
  57.    End
  58.    Begin VB.Label lblDFSize 
  59.       Alignment       =   1  'Right Justify
  60.       Caption         =   "Destination File Size:"
  61.       Height          =   255
  62.       Left            =   240
  63.       TabIndex        =   12
  64.       Top             =   2520
  65.       Width           =   1575
  66.    End
  67.    Begin VB.Label lblDFName 
  68.       Alignment       =   1  'Right Justify
  69.       Caption         =   "Destination Filename:"
  70.       Height          =   255
  71.       Left            =   240
  72.       TabIndex        =   11
  73.       Top             =   2160
  74.       Width           =   1575
  75.    End
  76.    Begin VB.Label lblSFSize 
  77.       Alignment       =   1  'Right Justify
  78.       Caption         =   "Source File Size:"
  79.       Height          =   255
  80.       Left            =   240
  81.       TabIndex        =   10
  82.       Top             =   1800
  83.       Width           =   1575
  84.    End
  85.    Begin VB.Label lblSFName 
  86.       Alignment       =   1  'Right Justify
  87.       Caption         =   "Source Filename:"
  88.       Height          =   255
  89.       Left            =   240
  90.       TabIndex        =   9
  91.       Top             =   1440
  92.       Width           =   1575
  93.    End
  94.    Begin VB.Label lblDestinationFilesize 
  95.       Alignment       =   1  'Right Justify
  96.       BorderStyle     =   1  'Fixed Single
  97.       Height          =   255
  98.       Left            =   1920
  99.       TabIndex        =   8
  100.       Top             =   2520
  101.       Width           =   2055
  102.    End
  103.    Begin VB.Label lblSourceFilesize 
  104.       Alignment       =   1  'Right Justify
  105.       BorderStyle     =   1  'Fixed Single
  106.       Height          =   255
  107.       Left            =   1920
  108.       TabIndex        =   7
  109.       Top             =   1800
  110.       Width           =   2055
  111.    End
  112.    Begin VB.Label lblDestinationFilename 
  113.       BorderStyle     =   1  'Fixed Single
  114.       Height          =   255
  115.       Left            =   1920
  116.       TabIndex        =   5
  117.       Top             =   2160
  118.       Width           =   3855
  119.    End
  120.    Begin VB.Label lblSourceFilename 
  121.       BorderStyle     =   1  'Fixed Single
  122.       Height          =   255
  123.       Left            =   1920
  124.       TabIndex        =   4
  125.       Top             =   1440
  126.       Width           =   3855
  127.    End
  128.    Begin ComctlLib.ProgressBar prgEncode 
  129.       Height          =   375
  130.       Left            =   240
  131.       TabIndex        =   0
  132.       Top             =   2880
  133.       Width           =   5535
  134.       _Version        =   65536
  135.       _ExtentX        =   9763
  136.       _ExtentY        =   661
  137.       _StockProps     =   192
  138.       Appearance      =   1
  139.       BorderStyle     =   1
  140.    End
  141. Attribute VB_Name = "frmMain"
  142. Attribute VB_Creatable = False
  143. Attribute VB_Exposed = False
  144. Private Sub CIMIME1_Decoded(ByVal BytesRead As Long, ByVal BytesWritten As Long, ByVal LinesDecoded As Long)
  145.   '     update progress with total bytes read
  146.   '     throughout the decode phase
  147.   prgEncode.Value = BytesRead
  148. End Sub
  149. Private Sub CIMIME1_DecodingFinished(ByVal Error As Integer)
  150.   '     display the actual destination
  151.   '     file size
  152.   lblDestinationFilesize.Caption = Format(CIMIME1.DestinationFileSize, _
  153.     "###,###,###")
  154.   '     display the source file name you
  155.   '     just decoded
  156.   MsgBox ("Finished decoding " & CIMIME1.SourceFilename)
  157.   '     enable all buttons
  158.   cmdDecode.Enabled = True
  159.   cmdEncode.Enabled = True
  160.   cmdQuit.Enabled = True
  161. End Sub
  162. Private Sub CIMIME1_DecodingStarted()
  163.   '     disable all buttons
  164.   '     because we are busy
  165.   cmdDecode.Enabled = False
  166.   cmdEncode.Enabled = False
  167.   cmdQuit.Enabled = False
  168.   '     intialize the progress bar
  169.   '     maximum
  170.   prgEncode.Max = CIMIME1.SourceFileSize
  171.   '     expand form so we can see
  172.   '     the progress bar
  173.   frmMain.Height = 3795
  174.   '     display source and destination
  175.   '     file name
  176.   lblSourceFilename.Caption = CIMIME1.SourceFilename
  177.   lblDestinationFilename.Caption = CIMIME1.DestinationFilename
  178.   '     display the actual source
  179.   '     file size
  180.   lblSourceFilesize.Caption = Format(CIMIME1.SourceFileSize, _
  181.   "###,###,###")
  182.   '     calculate the approximate destination
  183.   '     file size based on the source file size
  184.   nDestinationFilesize& = CIMIME1.SourceFileSize - (CIMIME1.SourceFileSize * 0.291)
  185.   lblDestinationFilesize.Caption = "approximately " & Format(Str$(LTrim$(nDestinationFilesize&)), _
  186.     "###,###,###")
  187. End Sub
  188. Private Sub CIMIME1_Encoded(ByVal BytesRead As Long, ByVal BytesWritten As Long, ByVal LinesEncoded As Long)
  189.   '     update progress with total bytes read
  190.   '     throughout the encode phase
  191.   prgEncode.Value = BytesRead
  192. End Sub
  193. Private Sub CIMIME1_EncodingFinished(ByVal Error As Integer)
  194.   '     display the actual destination
  195.   '     file size
  196.   lblDestinationFilesize.Caption = Format(CIMIME1.DestinationFileSize, _
  197.     "###,###,###")
  198.   '     display the source file name you
  199.   '     just decoded
  200.   MsgBox ("Finished encoding " & CIMIME1.SourceFilename)
  201.   '     enable all buttons
  202.   cmdDecode.Enabled = True
  203.   cmdEncode.Enabled = True
  204.   cmdQuit.Enabled = True
  205. End Sub
  206. Private Sub CIMIME1_EncodingStarted()
  207.   '     disable all buttons
  208.   '     because we are busy
  209.   cmdDecode.Enabled = False
  210.   cmdEncode.Enabled = False
  211.   cmdQuit.Enabled = False
  212.   '     intialize the progress bar
  213.   '     maximum
  214.   prgEncode.Max = CIMIME1.SourceFileSize
  215.   '     expand form so we can see
  216.   '     the progress bar
  217.   frmMain.Height = 3795
  218.   '     display source and destination
  219.   '     file name
  220.   lblSourceFilename.Caption = CIMIME1.SourceFilename
  221.   lblDestinationFilename.Caption = CIMIME1.DestinationFilename
  222.   '     display the actual source
  223.   '     file size
  224.   lblSourceFilesize.Caption = Format(CIMIME1.SourceFileSize, _
  225.   "###,###,###")
  226.   '     calculate the approximate destination
  227.   '     file size based on the source file size
  228.   nDestinationFilesize& = CIMIME1.SourceFileSize + (CIMIME1.SourceFileSize * 0.4009)
  229.   lblDestinationFilesize.Caption = "approximately " & Format(Str$(LTrim$(nDestinationFilesize&)), _
  230.     "###,###,###")
  231. End Sub
  232. Private Sub cmdDecode_Click()
  233.   '     decode a specified file
  234.   '     if a file has not been
  235.   '     specified, dialog boxes
  236.   '     will prompt you for a
  237.   '     source and destination
  238.   '     file
  239.   '     The MIMEDecode method initiates the
  240.   '     decode operation on a file
  241.   '     (named by the SourceFileName property).
  242.   '     It fires the DecodingFile event for
  243.   '     each attachment that is decoded.
  244.   CIMIME1.MIMEDecode
  245. End Sub
  246. Private Sub cmdEncode_Click()
  247.   '     encode a specified file
  248.   '     if a file has not been
  249.   '     specified, dialog boxes
  250.   '     will prompt you for a
  251.   '     source and destination
  252.   '     file
  253.   '     The MIMEEncode method initiates the
  254.   '     encode operation on a file
  255.   '     (named by the SourceFileName property).
  256.   '     The result of the encode operation resides
  257.   '     in the file identified by the
  258.   '     DestinationFileName property.
  259.   CIMIME1.MIMEEncode
  260. End Sub
  261. Private Sub cmdQuit_Click()
  262.   '     end the application
  263.   End
  264. End Sub
  265. Private Sub Form_Load()
  266.   '---------------------------------------------------------------------
  267.   ' Title:          MIME
  268.   ' Description:    Demonstrates the Crescent CIMIME Control allowing
  269.   '                 user selectable file encoding/decoding of any size
  270.   '                 file.
  271.   ' Author:         Stephen Casella
  272.   ' Last Revision:  May 2, 1996
  273.   '---------------------------------------------------------------------
  274.   '     center main form
  275.   frmMain.Top = Screen.Height \ 2 - frmMain.Height \ 2
  276.   frmMain.Left = Screen.Width \ 2 - frmMain.Width \ 2
  277.   '     explicitly show the form
  278.   frmMain.Show
  279.   '     initialize the progress
  280.   '     bar minimum
  281.   prgEncode.Min = 0
  282. End Sub
  283.